package org.jeecg.modules.screen.utils;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;

import org.jeecg.common.util.RedisUtil;
import org.jeecg.modules.screen.service.IScreenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.zip.ZipInputStream;


/**
 * 说明：流程管理总类
 */
@Component
public class BaseUtil {

	@Autowired
	private RedisUtil redisUtil;

	@Autowired
	private IScreenService screenService;


	/**
	 * 获取开关
	 * @return
	 */
	public  boolean getSwitch(){
//		Boolean checkCode = (Boolean)redisUtil.get("DemoSwicth");
		Boolean checkCode = null;
		if(null == checkCode){
			checkCode = screenService.getSwitch().equals("on")?true:false ;
			redisUtil.set("DemoSwicth",checkCode);
		}
		return checkCode;
	}

}




